package cn.iocoder.yudao.module.famous.doctor.dal.mysql.reply;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.famous.doctor.dal.dataobject.reply.FamReplyDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.famous.doctor.controller.admin.reply.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 谈论会回复 Mapper
 *
 * @author Test1
 */
@Mapper
public interface FamReplyMapper extends BaseMapperX<FamReplyDO> {

    default PageResult<FamReplyDO> selectPage(FamReplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FamReplyDO>()
                .eqIfPresent(FamReplyDO::getForumId, reqVO.getForumId())
                .eqIfPresent(FamReplyDO::getToreplyId, reqVO.getToreplyId())
                .eqIfPresent(FamReplyDO::getReplyUser, reqVO.getReplyUser())
                .eqIfPresent(FamReplyDO::getContent, reqVO.getContent())
                .eqIfPresent(FamReplyDO::getCollectCount, reqVO.getCollectCount())
                .betweenIfPresent(FamReplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FamReplyDO::getId));
    }

    default List<FamReplyDO> selectList(FamReplyExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<FamReplyDO>()
                .eqIfPresent(FamReplyDO::getForumId, reqVO.getForumId())
                .eqIfPresent(FamReplyDO::getToreplyId, reqVO.getToreplyId())
                .eqIfPresent(FamReplyDO::getReplyUser, reqVO.getReplyUser())
                .eqIfPresent(FamReplyDO::getContent, reqVO.getContent())
                .eqIfPresent(FamReplyDO::getCollectCount, reqVO.getCollectCount())
                .betweenIfPresent(FamReplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FamReplyDO::getId));
    }

    IPage<FamReplyRespTwoVO> selectPage2(Page<?> page,@Param("param") FamReplyPageTwoReqVO pageVO);
}
